package com.beadwallet.configserver;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@Slf4j
@EnableConfigServer
@EnableDiscoveryClient
@SpringBootApplication
public class ConfigServerApplication {

    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
        log.warn("==========config-server 开启负载均衡==========");
        return new RestTemplate();
    }

    public static void main(String[] args) {
        log.warn("==========启动config-server服务开始==========");
        SpringApplication.run(ConfigServerApplication.class, args);
        log.warn("==========启动config-server服务完毕==========");

    }
}
